package com.gm.wholesale.module.setting.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.gm.wholesale.R;

public class SettingLeftItemView extends LinearLayout {
    private TextView mTextView;
    private int viewId;

    public int getViewId() {
        return viewId;
    }

    public void setViewId(int viewId) {
        this.viewId = viewId;
    }

    public TextView getmTextView() {
        return mTextView;
    }

    public void setmTextView(TextView mTextView) {
        this.mTextView = mTextView;
    }

    public SettingLeftItemView(Context context) {
        super(context);
        initView(context);
    }

    public SettingLeftItemView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    private void initView(Context context) {
        LayoutInflater.from(context).inflate(R.layout.list_view_setting_item, this);
        mTextView = findViewById(R.id.nameTv);
    }

    public void showView(String text) {
        mTextView.setText(text);
    }

    public void setTextColor(int color) {
        mTextView.setTextColor(color);
    }

    public void setbgColor(){
        mTextView.setBackgroundColor(getResources().getColor(R.color.color_e4f4eb));
    }
    public void setbgWhiteColor(){
        mTextView.setBackgroundColor(getResources().getColor(R.color.white));
    }
}
